<%@ page contentType="text/html;charset=UTF-8"%>﻿
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>迅达客户关系管理系统</title>
	<link href="${ctx}/static/css/default.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="${ctx}/static/js/themes/default/easyui.css" />
	<link rel="stylesheet" type="text/css" href="${ctx}/static/js/themes/IconExtension.css" />
	<link rel="stylesheet" type="text/css" href="${ctx}/static/js/jquery-easyui-portal/portal.css" />
	<link rel="stylesheet" type="text/css" href="${ctx}/static/css/syCss.css" />
</head>
<body class="easyui-layout" style="overflow-y: hidden" fit="true" scroll="no">
	<c:import url="../common/easyLayout.jsp" ></c:import>
	
	<div id="mainPanle" region="center" style="background: #eee; overflow-y: hidden">
		<div id="tabs" class="easyui-tabs" fit="true" border="true">
			<div title="我的首页" style="padding: 10px; overflow: hidden;">
			<!--  
				<table border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td style="padding-right:10px;">
							<div id="p" class="easyui-panel" style="width:500px;height:200px;padding:10px;"
								title="公告"  fit="true"
								collapsible="true">
							
							</div>
						</td>
						<td>
							<div id="p" class="easyui-panel" style="width:500px;height:200px;padding:10px;"
								title="代办事项"  fit="true"
								collapsible="true">
							<p>待分派工单 <a style="color:red;" href="javascript:void(0)">3</a> 条 </p>
							<p>已分派工单 <a style="color:red;" href="javascript:void(0)">6</a> 条 </p>
							</div>
						</td>
					</tr>
				</table>
				-->
				<div id="portal" style="position:relative">
					<div></div>
					<div></div>
				</div>
				
			</div>
		</div>
	</div>
	
	<c:import url="../common/easyMenu.jsp" ></c:import>
	
	<script type="text/javascript" src="${ctx}/static/js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="${ctx}/static/js/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${ctx}/static/js/jquery.cookie.js"></script>
	<script type="text/javascript" src="${ctx}/static/js/jquery-easyui-portal/jquery.portal.js"></script>
	<script type="text/javascript" src='${ctx}/static/js/XiuCai.index.js'></script>
	<script>
	var ctx = '${ctx}';
	var portal;
	var panels;
	var toAddWorkBill = '${toAddWorkBill}';
	var phone = '${phone}';
	
	$(function() {
		panels = [ {
			id : 'p1',
			title : '公告栏',
			height : 200,
			collapsible : true,
			href:ctx+'/index/news',
			tools:[{iconCls:'icon-reload',handler:function(){$("#p1").panel('refresh');}}]
		}, {
			id : 'p2',
			title : '工单列表',
			height : 200,
			collapsible : true,
			href:ctx+'/index/workBillInfo',
			tools:[{iconCls:'icon-reload',handler:function(){$("#p2").panel('refresh');}}]
		}, {
			id : 'p4',
			title : '考勤打卡',
			height : 200,iconCls:'icon-calendar_edit',
			collapsible : true,
			href:ctx+'/index/daka'
		}, {
			id : 'p5',
			title : 'XXXX',
			height : 200,
			collapsible : true,
			href:ctx+'/index/news',
		} ];

		portal = $('#portal').portal({
			border : false,
			fit : true,
			onStateChange : function() {
				$.cookie('portal-state', getPortalState(), {
					expires : 7
				});
			}
		});
		var state = $.cookie('portal-state');
		if (!state) {
			state = 'p1,p2,:p4,p5';/*冒号代表列，逗号代表行*/
		}
		addPanels(state);
		portal.portal('resize');

	});

	function getPanelOptions(id) {
		for ( var i = 0; i < panels.length; i++) {
			if (panels[i].id == id) {
				return panels[i];
			}
		}
		return undefined;
	}
	function getPortalState() {
		var aa=[];
		for(var columnIndex=0;columnIndex<2;columnIndex++) {
			var cc=[];
			var panels=portal.portal('getPanels',columnIndex);
			for(var i=0;i<panels.length;i++) {
				cc.push(panels[i].attr('id'));
			}
			aa.push(cc.join(','));
		}
		return aa.join(':');
	}
	function addPanels(portalState) {
		var columns = portalState.split(':');
		for (var columnIndex = 0; columnIndex < columns.length; columnIndex++) {
			var cc = columns[columnIndex].split(',');
			for (var j = 0; j < cc.length; j++) {
				var options = getPanelOptions(cc[j]);
				if (options) {
					var p = $('<div/>').attr('id', options.id).appendTo('body');
					p.panel(options);
					portal.portal('add', {
						panel : p,
						columnIndex : columnIndex
					});
				}
			}
		}
	}
	</script>
	<script type="text/javascript" src='${ctx}/static/index/index.js'></script>
</body>
</html>